package com.nagarro.assignment1.inventory;

/**
 * Class for representing an imported item.
 * @author Shreyasi Agrawal
 * @version 1.0
 */
public class Imported extends Item {
	double duty;
	
	/**
	 * Method to calculate tax of an imported item, given the price
	 */
	@Override
	public double calculate(double price) {
		duty = (0.1) * price;
		
		/* Surcharge = 5 if final cost < = 100 
		 * Surcharge = 10 if final cost is between 100 and 200
		 * Surcharge = 5% of final cost if final cost > 200
		 */
		if((price + duty) <= 100) {
			tax = duty + 5;
		}
		else if(100 < (price + duty) && (price + duty) <= 200) {
			tax = duty + 10;
		}
		else {
			tax = duty + ((0.05) * (price + duty));
		}
		return tax;
	}
}